﻿Public Class clsGtProcedure

    Public Function getGtProcedure(oper_type As String, status As String) As DataTable
        Dim szSql As String = ""
        szSql &= "select a.*,b.oper_type,b.type_value,b.batch_no from sf.b_gt_procedure a left join sf.b_gt b on a.b_gt_sys_id = b.sys_id"
        szSql &= " where oper_type= ? and status in (" & status & ") order by update_time desc limit 1 "
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, oper_type)
        If IsNothing(dt) Then
            getGtProcedure = New DataTable
        Else
            getGtProcedure = dt
        End If
    End Function


    Public Function selectGtProcedure(b_gt_sys_id As String, procedure_No As String) As DataTable
        Dim szSql As String = ""
        szSql &= "select * from sf.b_gt_procedure "
        szSql &= " where b_gt_sys_id= ? and procedure_No = ? "
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, b_gt_sys_id, procedure_No)
        If IsNothing(dt) Then
            selectGtProcedure = New DataTable
        Else
            selectGtProcedure = dt
        End If
    End Function

    Public Function selectGtProcedure(b_gt_sys_id As String) As DataTable
        Dim szSql As String = ""
        szSql &= "select * from sf.b_gt_procedure "
        szSql &= " where b_gt_sys_id= ? "
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, b_gt_sys_id)
        If IsNothing(dt) Then
            selectGtProcedure = New DataTable
        Else
            selectGtProcedure = dt
        End If
    End Function

End Class
